package com.onlinebooking;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

@ManagedBean
@RequestScoped
public class CustomerController {
	
	@EJB
	private CustomerDao customerDao;
	
	private Customer customer = new Customer();
	
	public CustomerController() {
		// default constructor
	}

	/**
	 * @return the customer
	 */
	public Customer getCustomer() {
		return customer;
	}

	/**
	 * @param customer the customer to set
	 */
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}	
	
	public String createCustomer() {
		customer = customerDao.createCustomer(customer);
		return "registrationConfirmation.xhtml";
	}	

}
